package edu.ubb.bibliospring.backend.repository;

import edu.ubb.bibliospring.backend.exception.BiblioSpringRepositoryException;
import edu.ubb.bibliospring.backend.model.AbstractModel;
import javax.ejb.Local;
import java.util.List;

@Local
public interface BaseRepository<T extends AbstractModel, I>
{
    List<T> getAll() throws BiblioSpringRepositoryException;

    T getById(I id) throws BiblioSpringRepositoryException;

    T save(T item) throws BiblioSpringRepositoryException;

    T merge(T item) throws BiblioSpringRepositoryException;

    void delete(T item) throws BiblioSpringRepositoryException;
}
